/*
 *  Copyright 2010 Mahbub Mozadded Sowrov.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package com.sowrov.util.logsystem;


/**
 * LogFormatter Interface, any type of output formatter will have to implement this interface.
 * Example format implementation would be: Plain text, Html format, XML, JSon, etc.
 *
 * @author Sowrov
 * @version %I% %G%
 */
public interface LogFormatter {
    /**
     * construct a formated string for CRITICAL errors with the input parameters.
     *
     * @param message The Message
     * @param lineNo line No
     * @param functionName function name
     * @param fileName file name
     *
     * @return formatted string
     */
    String getCriticalFormat(
                             final String message, final int lineNo, final String functionName,
                             final String fileName);

    /**
     * Debug message formation method.
     *
     * @param message debug message
     * @param lineNo line No
     * @param functionName Function message
     * @param fileName file Name
     *
     * @return formatted string
     */
    String getDebugFormat(
                          final String message, final int lineNo, final String functionName, final String fileName);

    /**
     * construct a formated string for FATAL errors with the input parameters.
     *
     * @param message The Message
     * @param lineNo line No
     * @param functionName function name
     * @param fileName file name
     *
     * @return formatted string
     */
    String getFatalFormat(
                          final String message, final int lineNo, final String functionName, final String fileName);

    /**
     * Logger will write any text return by this method if the current device WAS used for logging any message
     * and the device is about to closed.
     *
     * @return final string to the device
     */
    String getFinalFormat();

    /**
     * Any message that you just want to show as information, this method implements the format of that info message.
     *
     * @param message information message
     * @param lineNo line No
     * @param functionName Function message
     * @param fileName file Name
     *
     * @return formatted string
     */
    String getInfoFormat(final String message, final int lineNo, final String functionName, final String fileName);

    /**
     * Any fresh device will write any message return by this method before writing any log message. HTML or
     * XML type log formatter should use this method for proper intro text, like for HTML it may return something like
     * this: "<html><head><title>This is Log Title</title></head><body></body></html>"
     *
     * @return initial string for any fresh device
     */
    String getIntroFormat();

    /**
     * Show an warning, implements its format.
     *
     * @param message warning message
     * @param lineNo Line No
     * @param functionName Function No
     * @param fileName File Name
     *
     * @return formatted string
     */
    String getWarningFormat(
                            final String message, final int lineNo, final String functionName,
                            final String fileName);
} // end LogFormatter
